﻿<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<!--#include file="page.asp"-->
<% 

if request("act") = "output" then

	Response.Buffer = True 
	Response.ContentType = "application/vnd.ms-excel" 
	Response.AddHeader "content-disposition", "inline; filename = shundeidea-excel-"& date &".xls" 
	
	if response.IsClientConnected then'是观察用户是否仍连到服务器
		response.Flush()
	else
		response.End()
	end if

end if





'if request.Cookies("printpreview_sql") = "" then


	tmpsql  = ""
	tmpsql1 = ""
	tmpsql2 = ""
	tmpsql3 = ""
	tmpsql4 = ""
	
	if Trim(request.form("user_name")) <> "" then tmpsql1 = tmpsql1 & " user_name like '%"& Trim(request.form("user_name")) &"%' "
	'if Trim(request.form("user_name")) <> "" then tmpsql1 = tmpsql1 & " user_name='" & Trim(request.form("user_name")) & "'"
	
	if Trim(request.form("CompanyName")) <> "" then tmpsql2 = tmpsql2 & " CompanyName like '%"& Trim(request.form("CompanyName")) &"%' "
	
	
	if Trim(request.form("jifen")) <>""  then
		if Trim(request.form("jifensel")) = 0 then
			tmpsql3 = tmpsql3 & " jifen < "& Trim(request.form("jifen")) 
		else
			tmpsql3 = tmpsql3 & " jifen > "& Trim(request.form("jifen")) 
		end if
	end if
	
	if Trim(request.form("LvJifen")) <>""  then
		if Trim(request.form("lvsel")) = 0 then
			tmpsql4 = tmpsql4 & " LvJifen < "& Trim(request.form("LvJifen")) 
		else
			tmpsql4 = tmpsql4 & " LvJifen > "& Trim(request.form("LvJifen")) 
		end if
	end if
	
	tmpsql = ""
	
	if tmpsql1 <> "" then 
		if tmpsql <> "" then 
			tmpsql = tmpsql & " and " 
		end if 
		
		tmpsql = tmpsql & tmpsql1
	end if
	
	if tmpsql2 <> "" then 
		if tmpsql <> "" then 
			tmpsql = tmpsql & " and " 
		end if 
		
		tmpsql = tmpsql & tmpsql2
	end if
	
	if tmpsql3 <> "" then 
		if tmpsql <> "" then 
			tmpsql = tmpsql & " and " 
		end if 
		
		tmpsql = tmpsql & tmpsql3
	end if
	
	if tmpsql4 <> "" then 
		if tmpsql <> "" then 
			tmpsql = tmpsql & " and " 
		end if 
		
		tmpsql = tmpsql & tmpsql4
	end if
	
	tmpsql = "select * from [user] where " & tmpsql

	'response.write tmpsql& "<br>" 
	
'	Response.Cookies("printpreview_sql") = tmpsql

'else
'
'	tmpsql = request.Cookies("printpreview_sql")
'	Response.Cookies("printpreview_sql") = ""
'
'end if

%> 



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>列表管理</title>
<style type="text/css">
<!--
body {font-size:12px;}
-->
</style>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
      
      
        <td><table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-family : sans-serif;">
          <tr height="25"  bgcolor="e9f1fa">
            <td align="center">ID</td>
            <td>用户名</td>
            <td>公司名称</td>
            <td>联系电话</td>
            <td>邮箱地址</td>
            <td align="center">积分</td>
            <td align="center">评级积分</td>
            <td align="center">状态</td>
            <td align="center">兑换积分有效期</td>
            <td align="center">评级积分有效期</td>
          </tr>
      <%	
    set rs=server.createobject("adodb.recordset") 
	exec = tmpsql
	'	response.Write(exec)
    rs.open exec,conn,1,1 
    if rs.eof then
		response.Write "&nbsp;暂无数据！"
		response.end
    else
		rs.PageSize =10 '每页记录条数
		iCount=rs.RecordCount '记录总数
		iPageSize=rs.PageSize
		maxpage=rs.PageCount 
		page=request("page")
		if Not IsNumeric(page) or page="" then
			page=1
		else
			page=cint(page)
		end if
		if page<1 then
			page=1
		elseif  page>maxpage then
			page=maxpage
		end if
		rs.AbsolutePage=Page
		if page=maxpage then
			x=iCount-(maxpage-1)*iPageSize
		else
			x=iPageSize
		end if	
    %>
      <%For i=1 To x%>
          
          
          <tr height="25"  bgcolor="ffffff">
            <td width="5%" align="center"><%=rs("id")%></td>
            <td width="15%"><%=rs("user_name")%></td>
            <td width="15%"><%=rs("CompanyName")%></td>
            <td width="10%"><%=rs("Phone")%></td>
            <td width="15%"><%=rs("Email")%></td>
            <td width="5%" align="center"><%=rs("Jifen")%></td>
            <td width="5%" align="center"><%=rs("LvJifen")%></td>
            <td width="8%" align="center"><%
			if rs("Status") = true then
			response.write "过期用户"
			else
			response.write "在租用户"
			end if
    %></td>
            <td width="12%" align="center"><%=rs("JifenPeriod")%></td>
            <td width="12%" align="center"><%=rs("LvJifenPeriod")%></td>
          </tr>
          
    <%rs.movenext
    next
	end if
    %>
          
          
        </table></td>
      </tr>
    </table>
      
      
    
    </td>
  </tr>
</table>

<%if request("act") <> "output" then%>



  <form name="form_search" method="post" action="admin_user_printpreview.asp?act=output" target="_blank">
<table width="488" border="0" align="center" cellpadding="5" cellspacing="2" bgcolor="cedced" style="display:none;">
    <tr>
      <td height="25" colspan="2" align="center" bgcolor="#FFFFFF"><strong>用户查询</strong></td>
    </tr>
    <tr>
      <td width="30%" bgcolor="#FFFFFF">　用户名</td>
      <td width="386" bgcolor="#FFFFFF"><input name="user_name" type="text" id="user_name" value="<%=request("user_name")%>" size="30"></td>
    </tr>
    <tr>
      <td height="25" bgcolor="#FFFFFF">　公司名称</td>
      <td height="25" bgcolor="#FFFFFF"><input type="text" name="CompanyName" id="CompanyName" size="30" value="<%=request("CompanyName")%>" ></td>
    </tr>
    <tr>
      <td height="25" bgcolor="#FFFFFF">　积分</td>
      <td height="25" bgcolor="#FFFFFF"><select name="jifensel" id="jifensel" style="width:100px;">
          <option value="0">小于</option>
          <option value="1" <%if Trim(request.form("jifensel")) = 1 then : response.write "selected=selected" %>>大于</option>
        </select>
        <input name="jifen" type="text" id="jifen" size="13" value="<%=request("jifen")%>" ></td>
    </tr>
    <tr>
      <td height="25" bgcolor="#FFFFFF">　评级积分</td>
      <td height="25" bgcolor="#FFFFFF"><select name="lvsel" id="lvsel" style="width:100px;">
          <option value="0">小于</option>
          <option value="1" <%if Trim(request.form("lvsel")) = 1 then : response.write "selected=selected" %>>大于</option>
        </select>
        <input name="LvJifen" type="text" id="LvJifen" size="13" value="<%=request("LvJifen")%>" ></td>
    </tr>
    <tr>
      <td height="25" bgcolor="#FFFFFF">&nbsp;</td>
      <td height="25" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td height="25" colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
</table>
<label>
  <input type="submit" name="button" id="button" value="数据导出" />
</label>
</form>

<%end if%>


</body> 
</html>
